package com.strategy.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
// 新增：导入 SpecVersion 类
import io.swagger.v3.oas.models.SpecVersion;


@Configuration
public class Swagger3Config {



    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .specVersion(SpecVersion.V31)
                .info(new Info()
                        .title("策略管理系统")
                        .version("1.0")
                        .description("策略管理相关的 API 文档")
                        .contact(new Contact().name("lijun").email("18142484@qq.com"))
                        .license(new License().name("Apache 2.0").url("https://springdoc.org"))
                        .termsOfService("https://swagger.io/terms/")
                )
                .addServersItem(new Server().url("http://localhost:8089").description("本地开发环境"));
    }
}
